package com.xintouyun.medicine.service.impl;

import java.util.List;

import com.xintoucloud.jdbcutil.JdbcUtil;
import com.xintouyun.medicine.dao.ConsigneeDao;
import com.xintouyun.medicine.entity.Consignee;
import com.xintouyun.medicine.service.AddressService;

public class AddressServiceImpl implements AddressService{
	private ConsigneeDao consigneeDao = new ConsigneeDao();

	@Override
	public int add(Consignee consignee) {
		int i = 0;
		try {
			i=consigneeDao.save(consignee);
		} finally {
			JdbcUtil.closeConnection();
		}
		
		return i;
	}

	@Override
	public List<Consignee> list(int uid) {
		try {
			List<Consignee> list = consigneeDao.list("select * from m_consignee where uid=?",uid);
			
			return list;
		} finally {
			JdbcUtil.closeConnection();
		}
	}


}
